package service.Impl;

import dao.Impl.NewsDaoImpl;
import dao.NewsDao;
import factory.SimpleDaoFactory;
import pojo.News;
import service.NewsService;

public class NewsServiceImpl implements NewsService {
//    NewsDao dao=new NewsDaoImpl();
    private NewsDao dao= SimpleDaoFactory.getInstance("mysql");

    private NewsDao newsDao;

    public void setNewsDao(NewsDao dao){
        this.newsDao=dao;
    }

    public void addNews(News news){
        newsDao.save(news);
    }


    @Override
    public void save(News news) {
        dao.save(news);
    }
}
